<template>
	<view class="content">
		<view class="logo-content">
			<view class="logo-content-top">
				<image src="/static/image/index/logo.png"></image>
			</view>
		</view>
		<view class="function-panel">
      <view class="panel-item">
        <navigator url="/pages/upload/upload" hover-class="none">
          <image class="panel-item-image" src="/static/image/index/panel/upload.png"></image>
          <text class="panel-item-tip">记录上传</text>
        </navigator>
      </view>
      <view class="panel-item">
				<navigator url="/pages/search/search?type=0" hover-class="none">
					<image class="panel-item-image" src="/static/image/index/panel/project.png"></image>
					<text class="panel-item-tip">项目查询</text>
				</navigator>
      </view>
      <view class="panel-item">
				<navigator url="/pages/search/search?type=1" hover-class="none">
					<image class="panel-item-image" src="/static/image/index/panel/welder.png"></image>
					<text class="panel-item-tip">焊工查询</text>
				</navigator>
      </view>
      <view class="panel-item">
				<navigator url="/pages/search/search?type=2" hover-class="none">
					<image class="panel-item-image" src="/static/image/index/panel/hot.png"></image>
					<text class="panel-item-tip">热熔记录</text>
				</navigator>
      </view>
      <view class="panel-item">
				<navigator url="/pages/search/search?type=3" hover-class="none">
					<image class="panel-item-image" src="/static/image/index/panel/electric.png"></image>
					<text class="panel-item-tip">电熔记录</text>
				</navigator>
      </view>
      <view class="panel-item">
				<navigator url="/pages/search/search?type=4" hover-class="none">
					<image class="panel-item-image" src="/static/image/index/panel/device.png"></image>
					<text class="panel-item-tip">设备查询</text>
				</navigator>
      </view>
		</view>
		<tab-bar ref='commentTabbat' :actives='0'></tab-bar>
		<message ref="message"></message>
	</view>
</template> 

<script>
	import tabBar from '../../components/tabbar.vue'

	export default {
		data() {
			return {
				
			}
		},
		methods: {
      checkIfLogin() {
        let username = uni.getStorageSync("username");
        let role = uni.getStorageSync("role");
        if (!username || !role) {
          uni.redirectTo({
            url: '/pages/login/login'
          })
        }
      }
		},
		components: {
			tabBar
		},
    onLoad() {
      this.checkIfLogin();
    },
    onReady() {
      this.$refs.message.setMessageToStore(this.$refs.message)
    }
	}
</script>

<style scoped lang="scss">
	@import "~@/static/css/index.scss";	
</style>
